
import { createReducer } from 'redux-immutablejs'
import { fromJS } from 'immutable'
import {
  GET_GOODS_INFO,GET_SUB_GOODS_INFO,ADD_CART_INFO,GET_CATE_GOODS
} from '../constants/goods'



export const goodsInfo = createReducer(fromJS({}), {
  [GET_GOODS_INFO]: (state, action) => {
    return fromJS(action.data)
  }
})
export const subGoodsInfo = createReducer(fromJS({}), {
  [GET_SUB_GOODS_INFO]: (state, action) => {
    return fromJS(action.data)
  }
})


export const addCartInfo = createReducer(fromJS({}), {
  [ADD_CART_INFO]: (state, action) => {
    return fromJS(action.data)
  }
})
